<!DOCTYPE HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<div role="treeitem" id="treeitem-uncheckable">Uncheckable</div>
<div role="treeitem" id="treeitem-false" aria-checked="false">Not checked</div>
<div role="treeitem" id="treeitem-true" aria-checked="true">Checked</div>
<div role="treeitem" id="treeitem-mixed" aria-checked="mixed">Mixed</div>


<script>
function axElementById(id) {
    return accessibilityController.accessibleElementById(id);
}

test(function(t) {
    var treeItem = axElementById("treeitem-uncheckable");
    assert_equals(treeItem.checked, "");
}, "A tree item with no aria-checked has no checked property");

test(function(t) {
    var treeItem = axElementById("treeitem-false");
    assert_equals(treeItem.checked, "false");
}, "A tree item with aria-checked=false has checked=false");

test(function(t) {
    var treeItem = axElementById("treeitem-true");
    assert_equals(treeItem.checked, "true");
}, "A tree item with aria-checked=true has checked=true");

test(function(t) {
    var treeItem = axElementById("treeitem-mixed");
    assert_equals(treeItem.checked, "mixed");
}, "A tree item with aria-checked=mixed has checked=mixed");

</script>
